import socket
import struct
import time
sk=socket.socket()
sk.connect(('127.0.0.1',9001))
# time.sleep(0.1)
lenth=sk.recv(4)
lenth=struct.unpack('i',lenth)[0]
print(lenth)
msg1=sk.recv(lenth)

msg2=sk.recv(1024)
print('msg1:',msg1.decode('utf-8'))
print('msg2:',msg2.decode('utf-8'))
msg_toserver=input('>>>>>')
sk.send(msg_toserver.encode('utf-8'))

sk.close()















